test:
	echo test

copy-file:
	cp -rf ../vagrant/puppet/modules/smx_nginx/files images/web/config/nginx/files
	cp images/web/config/nginx/common.conf images/web/config/nginx/files/vhost/
	sed s/'<%= @processorcount %>'/8/ ../vagrant/puppet/modules/smx_nginx/templates/nginx.conf.erb > images/web/config/nginx/files/nginx.conf
	sed -i '' s/vagrant/docker/ images/web/config/nginx/files/vhost/*
	cp -rf ../vagrant/puppet/modules/smx_php/files images/web/config/php/files
	cp ../vagrant/puppet/modules/smx_os/files/id_rsa images/web/config/server/id_rsa

start:start-mongodb start-platform start-worker start-cas start-cmis start-restheart
	echo start
	docker-compose run -d --service-ports a2ucx-web
	docker exec `docker ps -f name=web -q` /root/init-script/init.sh

start-mongodb:
	echo "start mongodb"
	docker-compose run -d --service-ports a2ucx-mongodb
	docker exec `docker ps -f name=mongodb -q` /root/init-script/init.sh

start-platform:
	echo "start platform"
	docker-compose run -d --service-ports a2ucx-platform

start-worker:
	echo "start worker"
	docker-compose run -d --service-ports a2ucx-worker

start-cas:
	echo "start cas"
	docker-compose run -d --service-ports a2ucx-cas

start-cmis:
	echo "start cmis"
	docker-compose run -d --service-ports a2ucx-cmis
	sleep 120
	docker exec `docker ps -f name=cmis -q` /root/createdb.sh cmis cmis cmis 1>/dev/null
	docker exec `docker ps -f name=cmis -q` systemctl restart tomcat

start-restheart:
	echo "start restheart"
	docker-compose run -d --service-ports a2ucx-restheart

start-web:
	echo "start web"
	docker-compose run -d --service-ports a2ucx-web
	docker exec `docker ps -f name=web -q` /root/init-script/init.sh

stop:
	docker rm -f `docker ps -f "name=a2ucx" -q`
	docker network rm `docker network ls -f "name=test" -q`
test2:
	echo test2